package com.hxit.contorller;

import com.hxit.pojo.AIModel;
import com.hxit.pojo.Result;
import com.hxit.servics.AiModelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author LENOVO
 * @version 1.0
 * @date 2024/11/5 11:21
 */
@RestController
@Slf4j
public class AiModelController {
    @Autowired
    private AiModelService aiModelService;
    //新增AiModels模型方法
    @PostMapping("/AddAiModels")
    public Result AddAiModels(@RequestBody AIModel aiModel){
        log.info("新增aimodel");
        aiModelService.AddAiModels(aiModel);
        return Result.success();
    }
    //删除AiModels模型方法
    @DeleteMapping("/DeleteModelsById/{ids}")
    public Result DeleteModelsById(@PathVariable List<Integer> ids){
        log.info("删除aimole模型");
        aiModelService.DeleteModelsById(ids);
        return Result.success();
    }
    //根据id查询模型信息方法
    @GetMapping("/FindModelById")
    public  Result FindModelById(@RequestParam("id") Integer id){
        log.info("根据id查模型信息");
        AIModel aiModel=aiModelService.FindModelById(id);
        return Result.success(aiModel);
    }
    //更新aimodels方法
    @PutMapping("/UpdateAiModels")
    public  Result UpdateAiModels(@RequestBody AIModel aiModel){
        log.info("更新aimodels");
        aiModelService.UpdateAiModels(aiModel);
        return Result.success();
    }

}

